﻿@using LKVMLMADMIN.Models;
@using PagedList.Mvc;
@using System.Globalization;
@{
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}
@using (Html.BeginForm("ListCommission", "Module", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-inline" }))
{
    <div id="wrapper">
        <div class="clear-fix"></div>
        <div class="row" style=" min-height: 110px; padding-left: 30px; ">
            <h3 class="page-header">Danh sách loại hoa hồng</h3>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="panel-body">
                    <div class="dataTable_wrapper">
                        <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                            <thead>
                                <tr style="font-family:'Times New Roman'">
                                    <th>STT</th>                                  
                                    <th>Mô tả</th>                               
                                </tr>
                            </thead>
                            <tbody style="font-family:'Times New Roman'">
                                @{int j = 0;}
                                @foreach (var item in ViewBag.ListCommission)
                                {
                                    j++;
                                    <tr>
                                        <td>@j</td>
                                        <td>
                                            @*<a class="" href="@Url.Action(item.CommissionName.Substring(7) + "/Index", item.CommissionName.Substring(7), new { commission = item.CommissionName.Substring(7) + "/Index" })">
                                               @item.CommissionDesc
                                            </a>*@

                                            <a class="" href="@Url.Action("Index", item.CommissionName.Substring(7))">
                                                @item.CommissionDesc
                                            </a>
                                        </td>                                                                                                     
                                    </tr>
                                }

                            </tbody>
                        </table>
                    </div>             
                </div>
            </div>
        </div>
    </div>
}
<script>
    $(document).ready(function () {
        $('input:checkbox').change(function (e) {
            e.preventDefault();
            var commission = $(this).attr('id').substr(3);
            var _val = $(this).prop('checked');
            $.ajax({
                dataType: "json",
                url: "/CongCu/ChangeSatusCommission?commission=" + commission + "&val=" + _val,
                success: function (data) {

                }
            });
        })
    });

</script>